import http from '../http'

//获取数据
export const employeeApi = (page) =>
    http({
        url: "/user/selectByPage",
        method: "POST",
        params: {
            page
        }
    })

//删除
export const employeeDelApi = (id) =>
    http({
        url: "/user/delete",
        method: "POST",
        params: {
            id
        }
    })

//改变状态
export const employeeStateApi = (id, isUsed) =>
    http({
        url: "/user/updateIsUsed",
        methed: "POST",
        data: {
            id,
            isUsed
        }
    })

//重置密码
export const employeeResetApi = (id, resetPassword) =>
    http({
        url: "/user/resetPassword",
        method: "POST",
        data: {
            id,
            resetPassword
        }
    })


//添加员工
export const employeeAddApi = (obj) => {
    console.log(obj);
    return http({
        url: "/user/add",
        method: "POST",
        data: obj
    })
}


//编辑员工
export const employeeEditApi = (obj) => {
    console.log(obj)
    return http({
        url: "/user/update",
        method: "POST",
        data: obj
    })

}
//员工总列表
export const employeeListApi=()=>
http({
    url:"/user/getUsers",
    method:"POST",
})


//模糊查询员工
export const employeeSelectApi=(name)=>
http({
    url:"/user/selectByName",
    method:"POST",
    data:{
        name
    }
})
